<template>
  <div class="irm-oper-div">
    <DictGroupComponent ref="dict">
      <DictDefineComponent dict-group="BM04002"/>
    </DictGroupComponent>
    <ToolBarComponent ref="mockQueryBar" bar-ref-name="inputBar">
      <InputComponent input-name="draftNo" validate="textMust" input-lable="报文号"/>
      <InputComponent input-name="orgDraftNo" input-lable="原报文号"/>
      <InputComponent input-name="memberId" input-lable="会员代码"/>
      <Button text="提交" :click-function="mockQueryBar"/>
    </ToolBarComponent>
    <GridComponent
        ref="mockGrid"
        :auto-load="true"
        key-property-name="id"
        grid-name="mockGrid"
        select-moduel="single"
        load-url="draft/queryMockInfo.do"
        max-height-prop="83%"
        :paging-moduel="true"
    >
      <GridColumnComponent width="150px" column-name="队列管理器ID" index-name="qmgrInfoId"/>
      <GridColumnComponent width="200px" column-name="报文号" index-name="draftNo"/>
      <GridColumnComponent width="200px" column-name="原报文号" index-name="oriDraftNo"/>
      <GridColumnComponent width="150px" column-name="Mock类型" index-name="mockType" :data-render="sysParamRender"/>
      <GridColumnComponent width="150px" column-name="接入点号" index-name="meetingCode"/>
      <GridColumnComponent width="150px" column-name="会员代码" index-name="memberId"/>
    </GridComponent>
  </div>
</template>

<script>
import InputComponent from "@/components/input/InputComponent";
import GridComponent from "@/components/grid/GridComponent";
import GridColumnComponent from "@/components/grid/GridColumnComponent";
import ToolBarComponent from "@/components/toolbar/ToolBarComponent";
import Button from "@/components/button/ButtonComponent";
import {translateByDict} from "@/common-util";
import DictGroupComponent from "@/components/dict/DictGroupComponent";
import DictDefineComponent from "@/components/dict/DictDefineComponent";

export default {
  name: "IrmOper",
  components: {
    DictDefineComponent,
    DictGroupComponent,
    ToolBarComponent, Button,
    GridColumnComponent, GridComponent, InputComponent
  },
  methods: {
    sysParamRender(columnData){
      return translateByDict(columnData,this.$refs["dict"].getDictGroup("BM04002"));
    },
    mockQueryBar(){
      let param = this.$refs["mockQueryBar"].getSubmitParams();
      this.$refs["mockGrid"].addQueryParams(param);
      this.$refs["mockGrid"].load();
    }
  }
}
</script>

<style scoped>
.irm-oper-div{
  height: 100%;
  overflow: auto;
}
</style>